﻿function zoom(obj) {
    $(obj.getSVGDocument()).show();
    svgPanZoom(obj, {
        zoomEnabled: true,
        panEnabled: true,
        dblClickZoomEnabled: true,
        controlIconsEnabled: true,
        fit: true,
        center: true,
        minZoom: 0.1
    });
    changedataval();
}

function dataget() {
    $.ajax({
        type: "Post",
        url: "Draw.aspx?method=Page_Load",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        data: { a:"a"},
        success: function (data) {
            alert(data.d);
        },
        error: function (xhr, type, errorThrown) {
            console.log("13");
        }
    })
}

function refresh() {
    changedataval();
    alert("已刷新数据")
}

function changedataval() {
    svgDocument = document.getElementById('svgarea').getSVGDocument();

    var text = new Array();
    text[0] = svgDocument.getElementById("tspan319-5-4-3-2-4");
    text[1] = svgDocument.getElementById("tspan319-5-4-3-2-9-4");
    text[2] = svgDocument.getElementById("tspan319-5-4-3-2-2-40");
    text[3] = svgDocument.getElementById("tspan319-5-4-3-2-0-2");

    text[4] = svgDocument.getElementById("tspan319-5-4-3-2-4-5");
    text[5] = svgDocument.getElementById("tspan319-5-4-3-2-9-4-4");
    text[6] = svgDocument.getElementById("tspan319-5-4-3-2-2-40-8");

    text[7] = svgDocument.getElementById("tspan319-5-4-3-2-4-5-8-3");
    text[8] = svgDocument.getElementById("tspan319-5-4-3-2-9-4-4-1-1");
    text[9] = svgDocument.getElementById("tspan319-5-4-3-2-2-40-8-7-6");

    text[10] = svgDocument.getElementById("tspan319-5-4-3-2-4-5-8-5");
    text[11] = svgDocument.getElementById("tspan319-5-4-3-2-9-4-4-1-7");
    text[12] = svgDocument.getElementById("tspan319-5-4-3-2-2-40-8-7-0");

    text[13] = svgDocument.getElementById("tspan319-5-4-3-2-4-5-8");
    text[14] = svgDocument.getElementById("tspan319-5-4-3-2-9-4-4-1");
    text[15] = svgDocument.getElementById("tspan319-5-4-3-2-2-40-8-7");

    text[16] = svgDocument.getElementById("tspan319-5-4-3-2-4-5-8-8");
    text[17] = svgDocument.getElementById("tspan319-5-4-3-2-9-4-4-1-8");
    text[18] = svgDocument.getElementById("tspan319-5-4-3-2-2-40-8-7-4");

    text[19] = svgDocument.getElementById("tspan319-5-4-3-2-4-5-0");
    text[20] = svgDocument.getElementById("tspan319-5-4-3-2-9-4-4-4");
    text[21] = svgDocument.getElementById("tspan319-5-4-3-2-2-40-8-3");

    text[22] = svgDocument.getElementById("tspan319-5-4-3-2-4-5-03");
    text[23] = svgDocument.getElementById("tspan319-5-4-3-2-9-4-4-6");
    text[24] = svgDocument.getElementById("tspan319-5-4-3-2-2-40-8-6");

    text[25] = svgDocument.getElementById("tspan319-5-4-3-2-4-5-6-5-3");

    text[26] = svgDocument.getElementById("tspan319-5-4-3-2-4-5-6");

    for (var i = 0; i < 27; i++) {
        text[i].firstChild.nodeValue = visValue[i] + visMearse[i];
    }
}